Skip to content

Conversation

hauntsaninja
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood
Copy link
Member

What does this do for us? mypy will already raise an error if a user tries to set an attribute on an object that hasn't been formally declared as an attribute of that object. And we already have all instance attributes on this class as read-only properties.

@hauntsaninja
Copy link
Collaborator Author

It doesn't do much, beyond mypy understanding what happens if you do UUID.__setattr__("attr", 5).
I was looking at this because it's one of the new errors from python/mypy#12203.

@hauntsaninja
Copy link
Collaborator Author

Actually no, this makes things worse, since mypy will give you worse (and depending on settings, sometimes no) diagnostics if you do u.doesnt_exist = 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants